<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<script th:src="@{/js/jquery.min.js}"></script>

<html>
<h3 th:text="'sesssionId:' + ${session.sessionId}"></h3>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>Insert title here</title>
</head>
<body>

<table align="center" width="100%" border="0" cellspacing="1" cellpadding="0" class="resulttable">
    <tr>
        <th width="20%">编号</th>
        <th width="20%">姓名</th>
        <th width="20%">地址</th>
        <th width="20%">电话</th>
        <th width="20%">操作</th>
    </tr>
    <tr th:if="${#lists.isEmpty(list)}">
        <td align="center" colspan="10" class="oddbgc">无记录</td>
    </tr>
    <tr th:each="resume,resumeState:${list}">
        <td align="center" th:text="${resume.id}" name = "id"/>
        <td align="center" th:text="${resume.name}" />
        <td align="center" th:text="${resume.address}"/>
        <td align="center" th:text="${resume.phone}"/>
        <td align="center"><input type="button" value="删除" th:onclick="deleteResume([[${resume.id}]])"></td>
    </tr>
</table>
<br/>
<br/>
<div align="center">
    <input type="button" value="新增" onclick="newResume()">
</div>

<script type="text/javascript">
    function deleteResume(current) {
        var data = {};
        data["id"] = current;
        jQuery.ajax({
            url: "/cluster-session-redis/test/delteResume",
            data: JSON.stringify(data),
            type: "POST",
            dataType: "json",
            contentType: "application/json;charset=utf-8",
            success: function (data) {
                if (data.status != '0000') {
                    alert("无此记录");
                } else {
                    window.location.href = "/cluster-session-redis/test/queryAllResume";
                }
            }
        });
    }

    function newResume() {
        window.open("/cluster-session-redis/test/insertResume");
    }
</script>


</body>
</html>